package filter;

import javax.servlet.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebFilter(filterName = "Filter02",urlPatterns = "/HelloServlet", initParams = { @WebInitParam(name = "username", value = "张三") })
public class Filter02 implements Filter {
    FilterConfig fc;
    @Override
    public void init(FilterConfig config) throws ServletException {
        this.fc = config;
    }

    @Override
    public void destroy() {
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException {
        response.getWriter().println("66666");

        response.getWriter().println(this.fc.getInitParameter("username"));

//        chain.doFilter(request, response);
    }
}
